package no.hio.wsprovider.services;

import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

import no.hio.wsprovider.vo.StockItem;

/**
 * WebService interface for StockItem.
 * @author Henning Gundersen
 * @version 1.0
 * @see StockItem
 */
@WebService(name="StockItemService", targetNamespace="http://hio.no/wsproviderstock")
public interface StockItemService 
{
	/**
	 * WebMethod for returning all stockItems in database
	 * @return all products.
	 */
	@WebMethod(operationName="findAllStockItems")
	@WebResult(name="stockItemList")
	public List<StockItem> findAllStockItems();
	
	
	/**
	 * Returns a specific stockItem based on productID
	 * @param productID
	 * @return Product with given ID, null if non-existent.
	 */
	@WebMethod(operationName="findByProductID")
	@WebResult(name="stockItem")
	public StockItem findByProductID(@WebParam(name="productID") int productID);
	
	
	/**
	 * Adds a stockItem to database
	 * @param stockItem StockItem to be added
	*/
	@WebMethod(operationName="insertStockItem")
	public void insertStockItem(@WebParam(name="stockItem")StockItem stockItem);

	
	/**
	 * Updates existing stockItem to database, uniqueness of stockItem
	 * is based on productID
	 * @param stockItem StockItem to be updated
	 */
	@WebMethod(operationName="updateStockItem")
	public void updateStockItem(@WebParam(name="stockItem")StockItem stockItem);
	
	/**
	 * Delete existing stockItem from database, uniqueness of stockItem
	 * is based on productID
	 * @param stockItem StockItem to be deleted
	 */
	@WebMethod(operationName="removeStockItem")
	public void removeStockItem(@WebParam(name="stockItem")StockItem stockItem);
}

